/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.myapp.entity;

import java.io.Serializable;
import java.util.Calendar;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author DTIT
 */
@Entity
@Table(name = "visit")
public class Visit implements Serializable {

  @Id
  @GeneratedValue(strategy = GenerationType.AUTO)
  private Long id;
  @ManyToOne(optional = false)
  private Client client;
  @Temporal(TemporalType.TIMESTAMP)
  private Date visitTime;
  private boolean deleted;
  @Lob
  @Column(length = 512)
  private String reasonForConsult;
  @Lob
  @Column(length = 512)
  private String historyOfPresentIllness;
  @Lob
  @Column(length = 512)
  private String subjective;
  @Lob
  @Column(length = 512)
  private String objective;
  @Lob
  @Column(length = 512)
  private String assessment;

  public String getReasonForConsult() {
    return reasonForConsult;
  }

  public void setReasonForConsult(String reasonForConsult) {
    this.reasonForConsult = reasonForConsult;
  }

  public String getHistoryOfPresentIllness() {
    return historyOfPresentIllness;
  }

  public void setHistoryOfPresentIllness(String historyOfPresentIllness) {
    this.historyOfPresentIllness = historyOfPresentIllness;
  }

  public String getSubjective() {
    return subjective;
  }

  public void setSubjective(String subjective) {
    this.subjective = subjective;
  }

  public String getObjective() {
    return objective;
  }

  public void setObjective(String objective) {
    this.objective = objective;
  }

  public String getAssessment() {
    return assessment;
  }

  public void setAssessment(String assessment) {
    this.assessment = assessment;
  }

  public String getPlan() {
    return plan;
  }

  public void setPlan(String plan) {
    this.plan = plan;
  }
  @Lob
  @Column(length = 512)
  private String plan;

  public Date getVisitTime() {
    return visitTime;
  }

  public void setVisitTime(Date visitTime) {
    this.visitTime = visitTime;
  }

  public boolean isDeleted() {
    return deleted;
  }

  public void setDeleted(boolean deleted) {
    this.deleted = deleted;
  }

  public Long getId() {
    return id;
  }

  public void setId(Long id) {
    this.id = id;
  }

  public void setClient(Client client) {
    this.client = client;
  }

  public Client getClient() {
    return client;
  }

  @Override
  public int hashCode() {
    int hash = 0;
    hash += (id != null ? id.hashCode() : 0);
    return hash;
  }

  @Override
  public boolean equals(Object object) {

    if (!(object instanceof Client)) {
      return false;
    }
    Visit other = (Visit) object;
    if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
      return false;
    }
    return true;
  }

  @Override
  public String toString() {
    return "com.myweb.entity.Visit[ id=" + id + " ]";
  }
}
